package com.mysky.client.mvp.audioplayer.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.mysky.client.mvp.audioplayer.event.MDPlayEvent.MDPlayEventHandler;

public class MDPlayEvent extends
		GwtEvent<MDPlayEventHandler> {

	public static final Type<MDPlayEventHandler> TYPE = new Type<MDPlayEventHandler>();

	private final String url;
	
	public MDPlayEvent(String url) {
		super();
		this.url = url;
	}

	public interface MDPlayEventHandler extends EventHandler {
		void handleEvent(MDPlayEvent event);
	}

	@Override
	public Type<MDPlayEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(MDPlayEventHandler handler) {
		handler.handleEvent(this);
	}

	public String getUrl() {
		return url;
	}
}